<? $section='Payment'; ?>
<?
        require_once 'inc/functions.php';
        $conn = getConnection();
        //print_r($conn);
                $result = $conn->query('SELECT * FROM Proj_Payment');
                
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
</head>

<body bgcolor="#333333">
<h1><img src="logo.png" alt="Logo" width="619" height="117" /></h1>
<? include("inc/tabs.php"); ?>
<div class="content">
<h2>Payment</h2>

<table border ="1">
        <tr>
        <th>Customer ID</th>
        <th>Payment ID</th>
        <th>Bill Address ID</th>
        <th>Updated At</th>
        <th>Ship Address ID</th>
	<th>CreditCard Name</th>
	<th>CreditCard Number</th>
	<th>CreditCard Exp. Date</th>
	<th>CreditCard CRV</th>
        </tr>
    
<? while($rs = $result->fetch_assoc()) { ?>
     <tr>
     <td><?=$rs['Customer_id']?></td>
     <td><?=$rs['Payment_id']?></td>
     <td><?=$rs['BillAddress_id']?></td>
     <td><?=$rs['updated_at']?></td>
     <td><?=$rs['ShipAddress_id']?></td>
     <td><?=$rs['CreditCard_name']?></td>
     <td><?=$rs['CreditCard_num']?></td>
     <td><?=$rs['CreditCard_expDate']?></td>
     <td><?=$rs['CreditCard_crv']?></td>

<? } ?>
</table>
<? $result = $conn->query('SELECT * FROM Proj_ShipAddress'); ?>
<h2>Ship Address</h2>

<table border ="1">
        <tr>
        <th>Ship Address ID</th>
        <th>Address Line 1</th>
        <th>Address Line 2</th>
        <th>City</th>
        <th>State</th>
        <th>Zip Code</th>
        <th>Country</th>
        <th>Created At</th>
        <th>Updated At</th>
        </tr>
    
<? while($rs = $result->fetch_assoc()) { ?>
     <tr>
     <td><?=$rs['ShipAddress_id']?></td>
     <td><?=$rs['AddressLine1']?></td>
     <td><?=$rs['AddressLine2']?></td>
     <td><?=$rs['City']?></td>
     <td><?=$rs['State']?></td>
     <td><?=$rs['ZipCode']?></td>
     <td><?=$rs['Country']?></td>
     <td><?=$rs['created_at']?></td>
     <td><?=$rs['updated_at']?></td>
     </tr>
<? } ?>
</table>
<? $result = $conn->query('SELECT * FROM Proj_BillAddress'); ?>
<h2>Bill Address</h2>

<table border ="1">
        <tr>
        <th>Bill Address ID</th>
        <th>Address Line 1</th>
        <th>Address Line 2</th>
        <th>City</th>
        <th>State</th>
        <th>Zip Code</th>
        <th>Country</th>
        <th>Created At</th>
        <th>Updated At</th>
        </tr>
    
<? while($rs = $result->fetch_assoc()) { ?>
     <tr>
     <td><?=$rs['BillAddress_id']?></td>
     <td><?=$rs['AddressLine1']?></td>
     <td><?=$rs['AddressLine2']?></td>
     <td><?=$rs['City']?></td>
     <td><?=$rs['State']?></td>
     <td><?=$rs['ZipCode']?></td>
     <td><?=$rs['Country']?></td>
     <td><?=$rs['created_at']?></td>
     <td><?=$rs['updated_at']?></td>
     </tr>
<? } ?>
</table>
</div>
</body>
</html>

<? $conn->close(); ?>